#pragma once

#include <AVUIEventableObject.h>

namespace AVUI {

class Dispatcher;

/// <summary>Represents an object that is associated with a <see cref="T:System.Windows.Threading.Dispatcher" />. </summary>
class DispatcherObject : public EventableObject
{
public:
    DECLARE_ELEMENT(DispatcherObject, Object);

#pragma region Public Methods

    /// <summary>Determines whether the calling thread has access to this <see cref="T:System.Windows.Threading.DispatcherObject" />.</summary>
    /// <returns>true if the calling thread has access to this object; otherwise, false.</returns>
    /// [EditorBrowsable(EditorBrowsableState.Never)]
    bool CheckAccess();

    /// <summary>Enforces that the calling thread has access to this <see cref="T:System.Windows.Threading.DispatcherObject" />.</summary>
    /// <exception cref="T:System.InvalidOperationException">the calling thread does not have access to this <see cref="T:System.Windows.Threading.DispatcherObject" />.</exception>
    /// [EditorBrowsable(EditorBrowsableState.Never)]
    void VerifyAccess();

#pragma endregion Public Methods

#pragma region Public Properties

    /// <summary>Gets the <see cref="T:System.Windows.Threading.Dispatcher" /> this <see cref="T:System.Windows.Threading.DispatcherObject" /> is associated with. </summary>
    /// <returns>The dispatcher.</returns>
    //[EditorBrowsable(EditorBrowsableState.Advanced)]
    DECLARE_READONLY_PROPERTY(Dispatcher, Dispatcher, false);
    Dispatcher* get_Dispatcher();

#pragma endregion Public Properties

protected:

#pragma region Protected Methods
    /// <summary>Initializes a new instance of the <see cref="T:System.Windows.Threading.DispatcherObject" /> class. </summary>
    DispatcherObject();

#pragma endregion Protected Methods

public:

#pragma region Internal Methods

    /// <summary>Detaches this dispatcher object from its associated dispatcher. </summary>
    void DetachFromDispatcher();

#pragma region Internal Methods


#pragma region Private Fields

private:
    Dispatcher* m_pDispatcher;

#pragma endregion Private Fields
};

};


